<?php

require_once('AIS_JsonRpc2ServiceImpl.php');
require_once('AIS_JsonRpc2SMDImpl.php');
require_once(dirname(__FILE__).'/../Validate/Interfaces/AIS_JsonValidate.php');
require_once dirname(__FILE__).'/../Validate/AIS_JsonRpcMethodParamsValidatorImpl.php';
class AIS_JsonRPCServer
{
	public static function serve($className)
	{
		$serv = new AIS_JsonRpc2ServiceImp();
$serv->setClass($className);
$serv->setMethodParamsValidator(new AIS_JsonRpcMethodParamsValidatorImpl());
$smd = new AIS_JsonRpc2SMDImpl();
$smd->setClass($className);

if (isset($_REQUEST["json"]))
{
	echo $serv->getJsonResponse(stripslashes($_REQUEST["json"]));
}
else{
	echo $smd->getSMD();
}
	}
}
?>